package com.colorful.insuranceproject.claims;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.TextView;

import com.colorful.insuranceproject.R;
import com.colorful.insuranceproject.base.TitleActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by handsome-Bob on 2017/8/18.
 * <p>
 * 步骤三：上传成功
 */
public class ClaimsStepThreeActivity extends TitleActivity {

    public static final String EXTRA_CLAIMS_ID = "extra_claims_id";

    @Bind(R.id.tv_order_num)
    TextView tvOrderNum;

    private String claimsId;

    @Override
    protected int getContentView() {
        return R.layout.activity_claims_step_three;
    }

    @Override
    protected void initViews() {
        ButterKnife.bind(this);
        hiddenTitle();
    }

    @Override
    protected void onViewInitialized() {
        claimsId = claimsId.substring(1, claimsId.length() - 1);
        tvOrderNum.setText(getString(R.string.upload_success_hint, claimsId));
    }

    @Override
    protected void onInitExtras(@NonNull Bundle bundle) {
        super.onInitExtras(bundle);
        claimsId = bundle.getString(EXTRA_CLAIMS_ID);
    }

    @Override
    public void restoreInstanceOnCreateBefore(@NonNull Bundle savedInstance) {

    }

    @Override
    public void restoreInstanceOnCreateAfter(@NonNull Bundle savedInstance) {

    }

    /**
     * 监听处理
     */
    @OnClick({R.id.tv_continue_uploading, R.id.tv_progress_view})
    void OnClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_continue_uploading:
                setResult(RESULT_OK);
                finish();
                break;
            case R.id.tv_progress_view:
                launchActivity(ClaimsProgressActivity.class);
                break;
        }
    }
}
